apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: validation-webhook.snapshot.storage.k8s.io
  {{- include "helm_lib_module_labels" (list . (dict "app" "snapshot-validation-webhook")) | nindent 2 }}
webhooks:
- name: validation-webhook.snapshot.storage.k8s.io
  rules:
  - apiGroups:   ["snapshot.storage.k8s.io"]
    apiVersions: ["v1", "v1beta1"]
    operations:  ["CREATE", "UPDATE"]
    resources:   ["volumesnapshots", "volumesnapshotcontents"]
    scope:       "*"
  clientConfig:
    service:
      namespace: "d8-{{ .Chart.Name }}"
      name: "snapshot-validation-webhook"
      path: "/volumesnapshot"
      port: 4443
    caBundle: {{ .Values.snapshotController.internal.webhookCert.ca | b64enc }}
  admissionReviewVersions:
  - v1
  sideEffects: None
  failurePolicy: Fail
  timeoutSeconds: 10
